Skip to content

Conversation

@Faheem12005
Copy link

@Faheem12005 Faheem12005 commented Nov 6, 2025

if index.tz is not None:
# Compare naive local times directly
period_naive = period.to_timestamp()
index_naive = index[0].tz_localize(None) # Strips tz, keeps local time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you call this ts_naive instead of index_naive.

index_naive = index[0].tz_localize(None) # Strips tz, keeps local time
return period_naive == index_naive
else:
return period.to_timestamp() == index[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an you call period.to_timestamp() just once before the branch

@jbrockmendel
Copy link
Member

needs a test for the bug this addresses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: timeseries (tz-aware) .plot() fails if timeseries begin is at edge of DST change-over

2 participants